package com.lingchen.entity;

import com.lingchen.utils.StringUtil;

/**
 * Author    lingchen
 * Email     838878458@qq.com
 * Time      2018/2/26
 * Function  错题题目
 */
public class Error {
    /**
     * id 自增
     */
    private long id;
    /**
     * 用户id
     */
    private long userName;

    /**
     * 科目id
     */
    private String courseId;
    /**
     * 科目
     */
    private Course course;

    /**
     * 题目id
     */
    private String choicesId;

    /**
     * 题目
     */
    private Choice choice;

    /**
     * 答案
     */
    private String answ;

    private int answTag;

    public Error() {
    }

    public Error(long userName, String courseId, String choicesId, String answ) {
        this.userName = userName;
        this.courseId = courseId;
        this.choicesId = choicesId;
        this.answ = answ;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUserName() {
        return userName;
    }

    public void setUserName(long userName) {
        this.userName = userName;
    }

    public String getChoicesId() {
        return choicesId;
    }

    public void setChoicesId(String choicesId) {
        this.choicesId = choicesId;
    }


    public Choice getChoice() {
        return choice;
    }

    public void setChoice(Choice choice) {
        this.choice = choice;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public String getAnsw() {
        return answ;
    }

    public void setAnsw(String answ) {
        this.answ = answ;
        setAnswTag(StringUtil.getAnsw(answ));
    }

    public int getAnswTag() {
        return answTag;
    }

    public void setAnswTag(int answTag) {
        this.answTag = answTag;
    }

    @Override
    public String toString() {
        return "Error{" +
                "id=" + id +
                ", userName=" + userName +
                ", courseId='" + courseId + '\'' +
                ", course=" + course +
                ", choicesId='" + choicesId + '\'' +
                ", choice=" + choice +
                ", answ='" + answ + '\'' +
                '}';
    }
}
